<?php $this->load->view('Import/navbar');?>
<h4><?=$typeName?></h4>
  <!-- Tab panes -->
  <div class="tab-content" style="margin-top: 10px;">
    <div role="tabpanel" class="tab-pane" id="<?=$_GET['m'] . $type?>">
        <!-- 查询框开始 -->
        <div class="table-responsive">
        <form class="form-inline" method="GET" name="query" id="query">
        <input type="hidden" name="c" id="c" value="<?=$_GET['c']?>">
        <input type="hidden" name="m" id="m" value="<?=$_GET['m']?>">
        <input type="hidden" name="type" id="type" value="<?=$type?>">
          <div class="form-group">
            <label for="year">所属年份：</label>
            <select class="form-control" id="year" name="year">
              <option value="">请选择</option>
          </select>
          </div>
          <div class="form-group">
          <label for="timeUnit">所属时间段：</label>
          <select class="form-control" id="timeUnit" name="timeUnit">
            <option value="">请选择</option>
        </select>
        </div>
          <div class="form-group">
            <button type="submit" class="btn btn-default btn-primary">搜索</button>
            <button type="button" class="btn btn-default" role="button" onclick="newWindow('<?=$typeName?>','<?php echo printUrl('Import','carLevelAdd', array('type'=>$type));?>',500,400)">添加<?=$typeName?></button>
          </div>
        </form>
        </div>
        <!-- 查询框结束 -->
        <!-- 表格列表 -->
        <div style="margin-top: 10px;">
        <table class="table">
            <thead>
              <tr>
                <th class="bg-primary text-center">序号</th>
                <th class="bg-primary text-center">类型</th>
                <th class="bg-primary text-center">所属双月</th>
                <th class="bg-primary text-center">名称</th>
                <th class="bg-primary text-center">当前状态</th>
                <th class="bg-primary text-center">排序</th>
                <th class="bg-primary text-center">操作</th>
              </tr>
            </thead>
            <tbody>
            <?php foreach($list as $k => $v): ?>
              <tr>
                <td class="text-center"><?php echo $v['id']; ?></td>
                <td class="text-center"><?php echo $v['typeStr']; ?></td>
                <td class="text-center"><?php echo $v['timeUnitStr']; ?></td>
                <td class="text-center"><?php echo $v['name'];?></td>
                <td class="text-center"><?php echo $v['statusStr'];?></td>
                <td class="text-center"><?php echo $v['orderNum'];?></td>
                <td class="text-center">
                <button class="btn btn-default btn-sm" type="button" onclick="newWindow('修改<?=$typeName?>','<?php echo printUrl('Import','carLevelAdd',array('id'=>$v['id']));?>',400,500)">修改</button>
                <button class="btn btn-default btn-sm" type="button" onclick="ajaxConfirmSubmit('您确定<?=$v['status']==1?'关闭':'开启';?>此<?=$typeName?>吗？','<?=printUrl('Import','carLevelStatus');?>',{'id':<?=$v['id']?>})"><?=$v['status']==1?'关闭':'开启';?></button>
                </td>
              </tr>
            <?php endforeach; ?>
            </tbody>
          </table>
        </div>
        <!-- 分页 -->
        <?=$pager?>
    </div>
  </div>
  <script type="text/javascript">
  $(function(){
      loadYearList('year',<?=$year ? $year : 0?>);
      loadTimeUnitList('timeUnit',<?=$year ? $year : 0?>,<?=$timeUnit ? $timeUnit : 0?>);
  });
  $("#year").change(function(){
      loadTimeUnitList('timeUnit',this.value);
    });
  </script>
<?php $this->load->view('Import/foot');?>